BeginRelinquishFocus
TheBeginRelinquishFocus
method should return a Boolean value that indicates whether this part is willing to relinquish the requested focus and should prepare this part to do so.
ODBoolean BeginRelinquishFocus (in ODTypeToken focus, in ODFrame ownerFrame, in ODFrame proposedFrame);
focus
- A tokenized string representing the focus type to be relinquished, expressed as a 32-bit value.
ownerFrame
- A reference to a display frame that currently possesses the focus.
proposedFrame
- A reference to a frame requesting ownership of the focus.
- return value
kODTrue
if this part is willing to relinquish the requested focus, otherwisekODFalse
.DISCUSSION
Thefocus
parameter must be the tokenized form of one of the focus constants (kODClipboardFocus
,kODKeyFocus
,kODMenuFocus
,kODModalFocus
,kODMouseFocus
,kODScrollingFocus
, orkODSelectionFocus
) or the tokenized form of a part-specific focus type. You can call the session object'sTokenize
method to obtain a token corresponding to one of these constants.OpenDoc calls this method when ownership of the specified focus is requested and this part is the current owner. Upon receiving this call, this part decides whether it can relinquish the specified focus. Each part has part-specific requirements that must be met before it can relinquish a focus. If these requirements are met, this part should be ready to relinquish the focus.
Your part's
BeginRelinquishFocus
method should return eitherkODTrue
orkODFalse
, based on the type of focus and the identities of the frames (current and proposed focus owners) passed in. In most cases, your method should returnkODTrue
. However, your method might returnkODFalse
, for example, if your part is displaying a modal dialog box and another part is requesting the modal focus. In that case, because your part does not want to yield the modal focus until its modal dialog box closes, your method should returnkODFalse
. In situations when your method does returnkODFalse
, then your part'sAbortRelinquishFocus
method does not need to take any action.Your part's
BeginRelinquishFocus
method should also ensure that, during the process of relinquishing the specified focus and before your part'sCommitRelinquishFocus
method is called, your part does not enter a state where the focus cannot be relinquished.OVERRIDING
When you subclassODPart
, you must override this method. Your override method must not call its inherited method; that is, your override method must implement this method's functionality completely.EXCEPTIONS
kODErrInvalidFrame
- The specified owner frame is not a display frame of this part.
SEE ALSO
TheODFocusType
type (page 889).
TheODTypeToken
type (page 877).
TheODPart::AbortRelinquishFocus
method (page 475).
TheODPart::CommitRelinquishFocus
method (page 488).
TheODSession::Tokenize
method (page 622).
"The BeginRelinquishFocus Method" on page 90 in OpenDoc Cookbook.
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"Requesting Foci" on page 208 in OpenDoc Programmer's Guide.
"Acquiring and Relinquishing the Modal Focus" on page 232 in OpenDoc Programmer's Guide.
"Creating a Focus Module" on page 448 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help